<!doctype html>
<html>
<head>
<meta charset="gbk" />
<title>Test Event</title>
<style>
.demo{width:400px;height:400px;background:red;}
</style>
<script src="../event.js"></script>
</head>
<body>
	<div class="demo" data-desc="this is a div!" id="demo"></div>
<script>
function $(id) {return document.getElementById(id);}

var demo1 = $('demo');
var fn1 = function(evt) {
	alert('[test duplicate bind]: ' + evt.type + ', ' + this.getAttribute('data-desc'));
};
var fn2 = function(evt) {
	alert('a[test "event"]:' + evt.type);
};
var fn3 = function(evt) {
	alert('b[test "this"]: ' + this.getAttribute('data-desc'));
};
Event.addEvent(demo1, 'click', fn2);
Event.addEvent(demo1, 'click', fn3);
Event.addEvent(demo1, 'click', fn1);
Event.addEvent(demo1, 'click', fn1);

// Event.removeEvent(demo1, 'click', fn1);
// Event.removeEvent(demo1, 'click', fn2);
// Event.removeEvent(demo1, 'click', fn3);

Event.addEvent(demo1, 'mouseover', fn2);
Event.addEvent(demo1, 'mouseover', fn3);
Event.addEvent(demo1, 'mouseover', fn1);
Event.addEvent(demo1, 'mouseover', fn1);

Event.removeEvent(demo1, 'click', fn1);
Event.removeEvent(demo1, 'click', fn2);
Event.removeEvent(demo1, 'click', fn3);
</script>
</body>
</html>
